This journal documents the analysis conducted for PVSC 2022 Mirletz et al conference presentation. It constitutes an initial demonstration of the energy flows of the PV ICE tool.
The comparison will be between a 100% remanfactured module and a 100% recycled module.
import os
from pathlib import Path
import PV_ICE
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
testfolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'TEMP'/'PVSC2022-Eflows')
# Another option using relative address; for some operative systems you might need '/' instead of '\'
# testfolder = os.path.abspath(r'..\..\PV_ICE\TEMP')
print ("Your simulation will be stored in %s" % testfolder)
if not os.path.exists(testfolder):
os.makedirs(testfolder)
Your simulation will be stored in C:\Users\hmirletz\Documents\GitHub\PV_ICE\PV_ICE\TEMP\PVSC2022-Eflows
PV_ICE.__version__
'v0.2.0+158.gc62e81e.dirty'
We wil create 3 scenarios:
These three scenarios will have the following assumptions:
cwd=os.getcwd()
print(os.getcwd())
C:\Users\hmirletz\Documents\GitHub\PV_ICE\docs\tutorials
MATERIALS = ['glass']#,'aluminium_frames','silver','silicon', 'copper', 'encapsulant', 'backsheet']
MATERIAL = MATERIALS[0]
#moduleFile_recycle = r'..\..\baselines\perovskite_modules_US_recycle.csv'
#moduleFile_reMFG = r'..\..\baselines\perovskite_modules_US_reMFG.csv'
moduleFile= r'..\..\baselines\perovskite_modules_US_linear.csv'
r1 = PV_ICE.Simulation(name='perovskite_energies', path=testfolder)
scenarios = ['linear', 'reMFG_low','reMFG_high', 'recycle_LQ', 'recycle_HQ_low','recycle_HQ_high']
for scen in scenarios:
r1.createScenario(name=scen, file=moduleFile)
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\perovskite_material_'+MATERIALS[mat]+'.csv'
r1.scenario[scen].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
#add c-Si 32-year module lifetime comparison
r1.createScenario(name='linear_longlife', file=moduleFile)
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\perovskite_material_'+MATERIALS[mat]+'.csv'
r1.scenario['linear_longlife'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
path = C:\Users\hmirletz\Documents\GitHub\PV_ICE\PV_ICE\TEMP\PVSC2022-Eflows
r1.scenario['linear'].data.keys()
Index(['year', 'new_Installed_Capacity_[MW]', 'mod_eff', 'mod_reliability_t50',
'mod_reliability_t90', 'mod_degradation', 'mod_lifetime', 'mod_MFG_eff',
'mod_Repair', 'mod_MerchantTail', 'mod_EOL_collection_eff',
'mod_EOL_pg0_resell', 'mod_EOL_pg1_landfill', 'mod_EOL_pg2_stored',
'mod_EOL_pg3_reMFG', 'mod_EOL_pg4_recycled', 'mod_EOL_reMFG_yield',
'mod_EOL_sp_reMFG_recycle', 'mod_EOL_pb1_landfill',
'mod_EOL_pb2_stored', 'mod_EOL_pb3_reMFG', 'mod_EOL_pb4_recycled'],
dtype='object')
r1.scenario['linear_longlife'].material['glass'].materialdata.keys()
Index(['year', 'mat_virgin_eff', 'mat_massperm2', 'mat_MFG_eff',
'mat_MFG_scrap_Recycled', 'mat_MFG_scrap_Recycling_eff',
'mat_MFG_scrap_Recycled_into_HQ',
'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG', 'mat_PG3_ReMFG_target',
'mat_ReMFG_yield', 'mat_PG4_Recycling_target', 'mat_Recycling_yield',
'mat_EOL_Recycled_into_HQ', 'mat_EOL_RecycledHQ_Reused4MFG'],
dtype='object')
#linear
r1.modifyScenario('linear', 'mod_Repair', 0.0) #this removes all weibull failures from field immediately
r1.modifyScenario('linear', 'mod_MerchantTail', 0.0) # this prevents extended use
r1.modifyScenario('linear', 'mod_EOL_collection_eff', 0.0) #this sends everytyhing to landfill
r1.scenario['linear'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 0.0) #send all mfg scrap to landfill
#linear
r1.modifyScenario('linear_longlife', 'mod_Repair', 0.0) #this removes all weibull failures from field immediately
r1.modifyScenario('linear_longlife', 'mod_MerchantTail', 0.0) # this prevents extended use
r1.modifyScenario('linear_longlife', 'mod_EOL_collection_eff', 0.0) #this sends everytyhing to landfill
#lifetime properties
r1.modifyScenario('linear_longlife', 'mod_reliability_t50', 34.41) #this sends everytyhing to landfill
r1.modifyScenario('linear_longlife', 'mod_reliability_t90', 38.9) #weibull for 32 year
r1.modifyScenario('linear_longlife', 'mod_degradation', 0.7) # curred c-Si average
r1.modifyScenario('linear_longlife', 'mod_lifetime', 32.0) #32 year lifetime is current c-Si average
r1.scenario['linear_longlife'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 0.0) #send all mfg scrap to landfill
#reMFG_low
#Module
r1.modifyScenario('reMFG_low', 'mod_EOL_collection_eff', 100.0) #this collects everything
#path good
r1.modifyScenario('reMFG_low', 'mod_EOL_pg0_resell', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_pg1_landfill', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_pg2_stored', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_pg3_reMFG', 100.0) #send all to remfg
r1.modifyScenario('reMFG_low', 'mod_EOL_reMFG_yield', 100.0) #100% yield of remfg
r1.modifyScenario('reMFG_low', 'mod_EOL_pg4_recycled', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_sp_reMFG_recycle', 0.0) #
#path bad
r1.modifyScenario('reMFG_low', 'mod_EOL_pb1_landfill', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_pb2_stored', 0.0) #
r1.modifyScenario('reMFG_low', 'mod_EOL_pb3_reMFG', 100.0) #sends all "bad" modules to remfg, uses same yield above
r1.modifyScenario('reMFG_low', 'mod_EOL_pb4_recycled', 0.0) #
#material
r1.scenario['reMFG_low'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 0.0) #send mfg scrap to landfill
r1.scenario['reMFG_low'].modifyMaterials('glass', 'mat_PG3_ReMFG_target', 100.0) #send all to remfg
r1.scenario['reMFG_low'].modifyMaterials('glass', 'mat_PG4_Recycling_target', 0.0) #send none to recycle
r1.scenario['reMFG_low'].modifyMaterials('glass', 'mat_ReMFG_yield', 50.0) #
#reMFG_high
#Module
r1.modifyScenario('reMFG_high', 'mod_EOL_collection_eff', 100.0) #this collects everything
#path good
r1.modifyScenario('reMFG_high', 'mod_EOL_pg0_resell', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_pg1_landfill', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_pg2_stored', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_pg3_reMFG', 100.0) #send all to remfg
r1.modifyScenario('reMFG_high', 'mod_EOL_reMFG_yield', 100.0) #100% yield of remfg
r1.modifyScenario('reMFG_high', 'mod_EOL_pg4_recycled', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_sp_reMFG_recycle', 0.0) #
#path bad
r1.modifyScenario('reMFG_high', 'mod_EOL_pb1_landfill', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_pb2_stored', 0.0) #
r1.modifyScenario('reMFG_high', 'mod_EOL_pb3_reMFG', 100.0) #sends all "bad" modules to remfg, uses same yield above
r1.modifyScenario('reMFG_high', 'mod_EOL_pb4_recycled', 0.0) #
#material
r1.scenario['reMFG_high'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 0.0) #send mfg scrap to landfill
r1.scenario['reMFG_high'].modifyMaterials('glass', 'mat_PG3_ReMFG_target', 100.0) #send all to remfg
r1.scenario['reMFG_high'].modifyMaterials('glass', 'mat_PG4_Recycling_target', 0.0) #send none to recycle
r1.scenario['reMFG_high'].modifyMaterials('glass', 'mat_ReMFG_yield', 99.0) #
#recycle_LQ
#module
r1.modifyScenario('recycle_LQ', 'mod_EOL_collection_eff', 100.0) #this collects everything
#path good
r1.modifyScenario('recycle_LQ', 'mod_EOL_pg0_resell', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pg1_landfill', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pg2_stored', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pg3_reMFG', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_reMFG_yield', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pg4_recycled', 100.0) #send all to recycle
r1.modifyScenario('recycle_LQ', 'mod_EOL_sp_reMFG_recycle', 0.0) #
#path bad
r1.modifyScenario('recycle_LQ', 'mod_EOL_pb1_landfill', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pb2_stored', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pb3_reMFG', 0.0) #
r1.modifyScenario('recycle_LQ', 'mod_EOL_pb4_recycled', 100.0) #send all to recycle
#material
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 100.0) #send all mfg scrap to recycle
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG', 0.0) #
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_PG3_ReMFG_target', 0.0) #send none to remfg
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_PG4_Recycling_target', 100.0) #send all to recycle
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_EOL_RecycledHQ_Reused4MFG', 0.0) #closed-loop
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_EOL_Recycled_into_HQ', 0.0) #HQ??
r1.scenario['recycle_LQ'].modifyMaterials('glass', 'mat_Recycling_yield', 50.0) #yield??
#recycle_HQ_low
#module
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_collection_eff', 100.0) #this collects everything
#path good
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pg0_resell', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pg1_landfill', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pg2_stored', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pg3_reMFG', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_reMFG_yield', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pg4_recycled', 100.0) #send all to recycle
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_sp_reMFG_recycle', 0.0) #
#path bad
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pb1_landfill', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pb2_stored', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pb3_reMFG', 0.0) #
r1.modifyScenario('recycle_HQ_low', 'mod_EOL_pb4_recycled', 100.0) #send all to recycle
#material
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled', 100.0) #send all mfg scrap to recycle
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG', 100.0) #
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_PG3_ReMFG_target', 0.0) #send none to remfg
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_PG4_Recycling_target', 100.0) #send all to recycle
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_EOL_RecycledHQ_Reused4MFG', 100.0) #closed-loop
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_EOL_Recycled_into_HQ', 100.0) #HQ??
r1.scenario['recycle_HQ_low'].modifyMaterials('glass', 'mat_Recycling_yield', 50.0) #yield??
#recycle_HQ_high
#module
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_collection_eff', 100.0) #this collects everything
#path good
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pg0_resell', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pg1_landfill', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pg2_stored', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pg3_reMFG', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_reMFG_yield', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pg4_recycled', 100.0) #send all to recycle
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_sp_reMFG_recycle', 0.0) #
#path bad
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pb1_landfill', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pb2_stored', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pb3_reMFG', 0.0) #
r1.modifyScenario('recycle_HQ_high', 'mod_EOL_pb4_recycled', 100.0) #send all to recycle
#material
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_MFG_scrap_Recycling_eff', 99.0) #send all mfg scrap to recycle
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled_into_HQ', 100.0) #send all mfg scrap to recycle
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG', 100.0) #send all mfg scrap to recycle
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_PG3_ReMFG_target', 0.0) #send none to remfg
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_PG4_Recycling_target', 100.0) #send all to recycle
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_Recycling_yield', 99.0) #yield
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_EOL_Recycled_into_HQ', 100.0) #HQ
r1.scenario['recycle_HQ_high'].modifyMaterials('glass', 'mat_EOL_RecycledHQ_Reused4MFG', 100.0) #closed-loop
r1.scenario['recycle_HQ_high'].material['glass'].materialdata.keys()
Index(['year', 'mat_virgin_eff', 'mat_massperm2', 'mat_MFG_eff',
'mat_MFG_scrap_Recycled', 'mat_MFG_scrap_Recycling_eff',
'mat_MFG_scrap_Recycled_into_HQ',
'mat_MFG_scrap_Recycled_into_HQ_Reused4MFG', 'mat_PG3_ReMFG_target',
'mat_ReMFG_yield', 'mat_PG4_Recycling_target', 'mat_Recycling_yield',
'mat_EOL_Recycled_into_HQ', 'mat_EOL_RecycledHQ_Reused4MFG'],
dtype='object')
r1.calculateMassFlow()
Working on Scenario: linear ******************** Finished Area+Power Generation Calculations Warning: Paths B 1 through 4 add to above 100%;Fixing by Updating Landfill value to the remainder of100-(P2+P3+P4). ==> Working on Material : glass Working on Scenario: reMFG_low ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass Working on Scenario: reMFG_high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass Working on Scenario: recycle_LQ ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass Working on Scenario: recycle_HQ_low ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass Working on Scenario: recycle_HQ_high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass Working on Scenario: linear_longlife ******************** Finished Area+Power Generation Calculations Warning: Paths B 1 through 4 add to above 100%;Fixing by Updating Landfill value to the remainder of100-(P2+P3+P4). ==> Working on Material : glass
r1.plotScenariosComparison('Landfill_0')
Warning: Keyword / Units not Found
mass_agg_yearly, mass_agg_sums = r1.aggregateResults()
mass_agg_yearly.to_csv('perovskite_mass_yearly.csv')
mass_agg_sums.to_csv('perovskite_mass_cumulatives.csv')
plt.rcParams.update({'font.size': 12})
plt.plot(mass_agg_yearly['ActiveCapacity_perovskite_energies_linear_[MW]']/1e6,
label='Effective Capacity [TW]', color='black')
#plt.plot(mass_agg_yearly['newInstalledCapacity_perovskite_energies_linear_[MW]']/1e6,
# label='Annually Added Capacity [TW]', color='blue')
plt.plot(mass_agg_yearly['DecommisionedCapacity_perovskite_energies_linear_[MW]']/1e6,
label='Decommissioned Capacity [TW]', color='red')
#plt.title('Capacity over time of 15-year module')
plt.ylabel('Capacity [TW]')
plt.ylim(0.0,1.0)
plt.legend()
<matplotlib.legend.Legend at 0x21018cd6730>
plt.figure(figsize=(8,5))
plt.rcParams.update({'font.size': 12})
plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_linear_[Tonnes]']/1e6,
label='Linear', color='black', lw=3)
#plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_recycle_LQ_[Tonnes]']/1e6,
# label='Recycle open-loop', color='blueviolet', linestyle='dotted', lw=3)
plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_reMFG_low_[Tonnes]']/1e6,
label='ReMFG low yield', color='limegreen', linestyle='dashed', lw=2)
plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_reMFG_high_[Tonnes]']/1e6,
label='ReMFG Perfect', color='forestgreen', linestyle='dashed', lw=3)
plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_recycle_HQ_low_[Tonnes]']/1e6,
label='Recycle closed-loop, low yield', color='deepskyblue', linestyle='dotted', lw=3)
plt.plot(mass_agg_yearly['VirginStock_glass_perovskite_energies_recycle_HQ_high_[Tonnes]']/1e6,
label='Recycle Perfect', color='royalblue', linestyle='dotted', lw=2)
#plt.title('Virgin Glass in Million Tonnes')
plt.ylabel('Virgin Glass Extracted [Mt]')
#plt.ylim(0.0,1.0)
plt.legend()
<matplotlib.legend.Legend at 0x21019e2ab20>
plt.figure(figsize=(8,5))
plt.rcParams.update({'font.size': 12})
plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_linear_[Tonnes]']/1e6,
label='Linear', color='black')
#plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_recycle_LQ_[Tonnes]']/1e6,
# label='Recycle open-loop', color='blueviolet', linestyle='dotted', lw=3)
plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_reMFG_low_[Tonnes]']/1e6,
label='ReMFG low yield', color='limegreen', linestyle='dashed', lw=2)
plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_reMFG_high_[Tonnes]']/1e6,
label='ReMFG Perfect', color='forestgreen', linestyle='dashed', lw=3)
plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_recycle_HQ_low_[Tonnes]']/1e6,
label='Recycle closed-loop, low yield', color='deepskyblue', linestyle='dotted', lw=4)
plt.plot(mass_agg_yearly['WasteAll_glass_perovskite_energies_recycle_HQ_high_[Tonnes]']/1e6,
label='Recycle Perfect', color='royalblue', linestyle='dotted', lw=3)
#plt.title('Waste Glass in Million Tonnes')
plt.ylabel('Waste Glass Disposed [Mt]')
#plt.ylim(0.0,1.0)
plt.legend()
<matplotlib.legend.Legend at 0x21019ea8c40>
First read in the energy files. Point at a path, then use the PV ICE colde to handle the meta data. Energy values for modules are in kWh/m2 and for materials are in kWh/kg. To ensure unit matching, we will divide the input by 1000 to convert kg to g.
matEfile_glass = str(Path().resolve().parent.parent / 'baselines'/'perovskite_energy_material_glass.csv')
modEfile = str(Path().resolve().parent.parent / 'baselines'/'perovskite_energy_modules.csv')
# Material energy file in Wh/g
file = matEfile_glass
csvdata = open(str(file), 'r', encoding="UTF-8")
csvdata = open(str(file), 'r', encoding="UTF-8-sig")
firstline = csvdata.readline()
secondline = csvdata.readline()
head = firstline.rstrip('\n').split(",")
meta = dict(zip(head, secondline.rstrip('\n').split(",")))
data = pd.read_csv(csvdata, names=head)
data.loc[:, data.columns != 'year'] = data.loc[:, data.columns != 'year'].astype(float)
matEfile_glass_simple = data.copy()
#module energy file in Wh/m2
file = modEfile
csvdata = open(str(file), 'r', encoding="UTF-8")
csvdata = open(str(file), 'r', encoding="UTF-8-sig")
firstline = csvdata.readline()
secondline = csvdata.readline()
head = firstline.rstrip('\n').split(",")
meta = dict(zip(head, secondline.rstrip('\n').split(",")))
data = pd.read_csv(csvdata, names=head)
data.loc[:, data.columns != 'year'] = data.loc[:, data.columns != 'year'].astype(float)
modEfile_simple = data.copy()
Now run the energy calculation. Currently this is not a class, just a function that will return a dataframe. Each scenario will need to be run seperately, and read in the perovskite energy files. The results are like the aggregate mass results function in that an annual and a cumulative dataframe are returned.
r1_e_linear, r1_e_linear_cum = r1.calculateEnergyFlow(scenarios='linear', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_linear_longlife, r1_e_linear_longlife_cum = r1.calculateEnergyFlow(scenarios='linear_longlife', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_reMFG_low, r1_e_reMFG_low_cum = r1.calculateEnergyFlow(scenarios='reMFG_low', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_reMFG_high, r1_e_reMFG_high_cum = r1.calculateEnergyFlow(scenarios='reMFG_high', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_reCYCLE_LQ, r1_e_reCYCLE_LQ_cum = r1.calculateEnergyFlow(scenarios='recycle_LQ', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_reCYCLE_HQ_low, r1_e_reCYCLE_HQ_low_cum = r1.calculateEnergyFlow(scenarios='recycle_HQ_low', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
r1_e_reCYCLE_HQ_high, r1_e_reCYCLE_HQ_high_cum = r1.calculateEnergyFlow(scenarios='recycle_HQ_high', materials='glass', modEnergy=modEfile_simple, matEnergy=matEfile_glass_simple)
#note that the cumulative ones sum the two types of recycling together which may not be applicable.
r1_e_linear.index = modEfile_simple['year']
r1_e_linear_longlife.index = modEfile_simple['year']
r1_e_reMFG_low.index = modEfile_simple['year']
r1_e_reMFG_high.index = modEfile_simple['year']
r1_e_reCYCLE_LQ.index = modEfile_simple['year']
r1_e_reCYCLE_HQ_low.index = modEfile_simple['year']
r1_e_reCYCLE_HQ_high.index = modEfile_simple['year']
r1_e_linear.keys()
Index(['mod_MFG', 'mod_Install', 'mod_OandM', 'mod_Repair', 'mod_Demount',
'mod_Store', 'mod_Resell_Certify', 'mod_ReMFG_Disassembly',
'mod_Recycle_Crush', 'mat_extraction', 'mat_MFG_virgin',
'mat_MFGScrap_LQ', 'mat_MFGScrap_HQ', 'mat_Landfill',
'mat_EoL_ReMFG_clean', 'mat_Recycled_LQ', 'mat_Recycled_HQ',
'e_out_annual_[Wh]'],
dtype='object')
for key in r1_e_linear.keys():
plt.plot(r1_e_linear.index, r1_e_linear[key], marker='s', ms=12, label='linear')
plt.plot(r1_e_reMFG_low.index, r1_e_reMFG_low[key], marker='^', ms=12, label='reMFG_low')
plt.plot(r1_e_reMFG_high.index, r1_e_reMFG_high[key], marker='^', ms=8, label='reMFG_high')
plt.plot(r1_e_reCYCLE_LQ.index, r1_e_reCYCLE_LQ[key], marker='o',ms=10, label='reCYCLE_LQ')
plt.plot(r1_e_reCYCLE_HQ_low.index, r1_e_reCYCLE_HQ_low[key], marker='X', color='purple', label='reCYCLE_HQ_low')
plt.plot(r1_e_reCYCLE_HQ_high.index, r1_e_reCYCLE_HQ_high[key], marker='X', color='purple', label='reCYCLE_HQ_high')
plt.legend()
plt.title(str(key))
plt.show()
The negative values are a product of the 15 year lifetime, and suddenly providing more material than necessary in a mfging year. Ideally, we would address this through storage for next year offsetting - to be developed. These negative values can be exacerbated by deployment curves.
energy_annual = pd.concat([r1_e_linear, r1_e_linear_longlife, r1_e_reMFG_low, r1_e_reMFG_high, r1_e_reCYCLE_LQ,
r1_e_reCYCLE_HQ_low, r1_e_reCYCLE_HQ_high], axis=1,
keys=['linear', 'linear_longlife', 'reMFG_low','reMFG_high', 'recycle_LQ', 'recycle_HQ_low','recycle_HQ_high'])
#this is a multiindex column, and filter doesn't work with it
energy_annual.to_csv('energyyearly.csv')
energy_sums = pd.concat([r1_e_linear_cum, r1_e_linear_longlife_cum, r1_e_reMFG_low_cum, r1_e_reMFG_high_cum,
r1_e_reCYCLE_LQ_cum, r1_e_reCYCLE_HQ_low_cum, r1_e_reCYCLE_HQ_high_cum], axis=1)
energy_sums.to_csv('energysums.csv')
#categorize the energy in values into lifecycle stages
mfg_energies = ['mod_MFG','mat_extraction','mat_MFG_virgin']
mfg_recycle_energies_LQ = ['mat_MFGScrap_LQ'] #LQ and HQ are separate becuase LQ is only LQ
mfg_recycle_energies_HQ = ['mat_MFGScrap_HQ'] #and HQ material is E_LQ + E_HQ
use_energies = ['mod_Install','mod_OandM','mod_Repair']
eol_energies = ['mat_Landfill','mod_Demount','mod_Store','mod_Resell_Certify']
eol_remfg_energies = ['mod_ReMFG_Disassmbly','mat_EoL_ReMFG_clean']
eol_recycle_energies_LQ = ['mod_Recycle_Crush','mat_Recycled_LQ']
eol_recycle_energies_HQ = ['mod_Recycle_Crush','mat_Recycled_HQ']
#example filtering
energy_sums.filter(items=mfg_energies, axis=0).filter(regex='linear$')
| linear | |
|---|---|
| mod_MFG | 2.391559e+13 |
| mat_extraction | 9.398494e+11 |
| mat_MFG_virgin | 3.183361e+14 |
#energy in for the linear system (includes LQ and HQ recycling, which might not be right)
e_in_mfg_linear = energy_sums.filter(items=mfg_energies, axis=0).filter(regex='linear$').sum()
e_in_use_linear = energy_sums.filter(items=use_energies, axis=0).filter(regex='linear$').sum()
e_in_eol_linear = energy_sums.filter(items=eol_energies, axis=0).filter(regex='linear$').sum()
e_in_linear_tab = pd.concat([e_in_mfg_linear,e_in_use_linear,e_in_eol_linear], axis=1)
e_in_linear_tab.columns = ['mfg','use','eol']
e_in_linear = e_in_mfg_linear + e_in_use_linear + e_in_eol_linear
print('Energy_in for the linear perovskite is ' + str(round(e_in_linear[0],2)) + ' kWh.')
Energy_in for the linear perovskite is 367159707168616.2 kWh.
#energy in for reMFG_low
e_in_mfg_remfg_low = energy_sums.filter(items=mfg_energies, axis=0).filter(like='reMFG_low').sum()
e_in_use_remfg_low = energy_sums.filter(items=use_energies, axis=0).filter(like='reMFG_low').sum()
e_in_eol_remfg_low = energy_sums.filter(items=eol_energies, axis=0).filter(like='reMFG_low').sum()
e_in_remfg_remfg_low = energy_sums.filter(items=eol_remfg_energies, axis=0).filter(like='reMFG_low').sum()
e_in_remfg_low_tab = pd.concat([e_in_mfg_remfg_low, e_in_use_remfg_low, e_in_eol_remfg_low, e_in_remfg_remfg_low], axis=1)
e_in_remfg_low_tab.columns = ['mfg','use','eol','remfg']
e_in_remfg_low = e_in_mfg_remfg_low + e_in_use_remfg_low + e_in_eol_remfg_low + e_in_remfg_remfg_low
print('Energy_in for reMFG_low is ' + str(round(e_in_remfg_low[0],2)) +' kWh.')
Energy_in for reMFG_low is 318657465707866.1 kWh.
#energy in for reMFG_high
e_in_mfg_remfg_high = energy_sums.filter(items=mfg_energies, axis=0).filter(like='reMFG_high').sum()
e_in_use_remfg_high = energy_sums.filter(items=use_energies, axis=0).filter(like='reMFG_high').sum()
e_in_eol_remfg_high = energy_sums.filter(items=eol_energies, axis=0).filter(like='reMFG_high').sum()
e_in_remfg_remfg_high = energy_sums.filter(items=eol_remfg_energies, axis=0).filter(like='reMFG_high').sum()
e_in_remfg_tab_high = pd.concat([e_in_mfg_remfg_high, e_in_use_remfg_high, e_in_eol_remfg_high, e_in_remfg_remfg_high], axis=1)
e_in_remfg_tab_high.columns = ['mfg','use','eol','remfg']
e_in_remfg_high = e_in_mfg_remfg_high + e_in_use_remfg_high + e_in_eol_remfg_high + e_in_remfg_remfg_high
print('Energy_in for reMFG_high is ' + str(round(e_in_remfg_high[0],2)) +' kWh.')
Energy_in for reMFG_high is 246289206250111.28 kWh.
#energy in for recycle_LQ
e_in_mfg_recycle_LQ = energy_sums.filter(items=mfg_energies, axis=0).filter(regex='recycle_LQ').sum()
e_in_mfgscrap_recycle_LQ = energy_sums.filter(items=mfg_recycle_energies_LQ, axis=0).filter(regex='recycle_LQ').sum()
e_in_use_recycle_LQ = energy_sums.filter(items=use_energies, axis=0).filter(regex='recycle_LQ').sum()
e_in_eol_recycle_LQ = energy_sums.filter(items=eol_energies, axis=0).filter(regex='recycle_LQ').sum()
e_in_recycle_recycle_LQ = energy_sums.filter(items=eol_recycle_energies_LQ, axis=0).filter(regex='recycle_LQ').sum()
e_in_recycle_tab_LQ = pd.concat([e_in_mfg_recycle_LQ, e_in_mfgscrap_recycle_LQ, e_in_use_recycle_LQ,
e_in_eol_recycle_LQ, e_in_recycle_recycle_LQ], axis=1)
e_in_recycle_tab_LQ.columns = ['mfg','mfgscrap','use','eol','eolrecycle']
e_in_recycle_LQ = e_in_mfg_recycle_LQ + e_in_mfgscrap_recycle_LQ + e_in_use_recycle_LQ + e_in_eol_recycle_LQ + e_in_recycle_recycle_LQ
print('Energy_in for recycled perovkiste is ' + str(round(e_in_recycle_LQ[0],2)) +' kWh.')
Energy_in for recycled perovkiste is 428632937672570.4 kWh.
#energy in for recycle_HQ_low
e_in_mfg_recycle_HQ_low = energy_sums.filter(items=mfg_energies, axis=0).filter(like='recycle_HQ_low').sum()
e_in_mfgscrap_recycle_HQ_low = energy_sums.filter(items=mfg_recycle_energies_HQ, axis=0).filter(like='recycle_HQ_low').sum()
e_in_use_recycle_HQ_low = energy_sums.filter(items=use_energies, axis=0).filter(like='recycle_HQ_low').sum()
e_in_eol_recycle_HQ_low = energy_sums.filter(items=eol_energies, axis=0).filter(like='recycle_HQ_low').sum()
e_in_recycle_recycle_HQ_low = energy_sums.filter(items=eol_recycle_energies_HQ, axis=0).filter(like='recycle_HQ_low').sum()
e_in_recycle_HQ_low_tab = pd.concat([e_in_mfg_recycle_HQ_low, e_in_mfgscrap_recycle_HQ_low, e_in_use_recycle_HQ_low,
e_in_eol_recycle_HQ_low, e_in_recycle_recycle_HQ_low], axis=1)
e_in_recycle_HQ_low_tab.columns = ['mfg','mfgscrap','use','eol','eolrecycle']
e_in_recycle_HQ_low = e_in_mfg_recycle_HQ_low + e_in_mfgscrap_recycle_HQ_low + e_in_use_recycle_HQ_low + e_in_eol_recycle_HQ_low + e_in_recycle_recycle_HQ_low
print('Energy_in for the perfect recycled perovkiste is ' + str(round(e_in_recycle_HQ_low[0],2)) +' kWh.')
Energy_in for the perfect recycled perovkiste is 329465958198418.2 kWh.
#energy in for recycle_HQ_high
e_in_mfg_recycle_HQ_high = energy_sums.filter(items=mfg_energies, axis=0).filter(like='recycle_HQ_high').sum()
e_in_mfgscrap_recycle_HQ_high = energy_sums.filter(items=mfg_recycle_energies_HQ, axis=0).filter(like='recycle_HQ_high').sum()
e_in_use_recycle_HQ_high = energy_sums.filter(items=use_energies, axis=0).filter(like='recycle_HQ_high').sum()
e_in_eol_recycle_HQ_high = energy_sums.filter(items=eol_energies, axis=0).filter(like='recycle_HQ_high').sum()
e_in_recycle_recycle_HQ_high = energy_sums.filter(items=eol_recycle_energies_HQ, axis=0).filter(like='recycle_HQ_high').sum()
e_in_recycle_HQ_high_tab = pd.concat([e_in_mfg_recycle_HQ_high, e_in_mfgscrap_recycle_HQ_high, e_in_use_recycle_HQ_high,
e_in_eol_recycle_HQ_high, e_in_recycle_recycle_HQ_high], axis=1)
e_in_recycle_HQ_high_tab.columns = ['mfg','mfgscrap','use','eol','eolrecycle']
e_in_recycle_HQ_high = e_in_mfg_recycle_HQ_high + e_in_mfgscrap_recycle_HQ_high + e_in_use_recycle_HQ_high + e_in_eol_recycle_HQ_high + e_in_recycle_recycle_HQ_high
print('Energy_in for the perfect recycled perovkiste is ' + str(round(e_in_recycle_HQ_high[0],2)) +' kWh.')
Energy_in for the perfect recycled perovkiste is 290069675027206.5 kWh.
e_in_cat_tab = pd.concat([e_in_linear_tab, e_in_remfg_low_tab, e_in_remfg_tab_high,
e_in_recycle_tab_LQ, e_in_recycle_HQ_low_tab, e_in_recycle_HQ_high_tab] )
e_in_cat_tab.to_csv('energy_in_by_category.csv')
e_in = pd.DataFrame(pd.concat([e_in_linear, e_in_remfg_low, e_in_remfg_high,
e_in_recycle_LQ, e_in_recycle_HQ_low, e_in_recycle_HQ_high]), columns=['E_in_MWh'])
e_in_norm = e_in/e_in.iloc[0]
e_in_norm
| E_in_MWh | |
|---|---|
| linear | 1.000000 |
| reMFG_low | 0.867899 |
| reMFG_high | 0.670796 |
| recycle_LQ | 1.167429 |
| recycle_HQ_low | 0.897337 |
| recycle_HQ_high | 0.790037 |
scennames = ['linear','reMFG_low','reMFG_high', 'recycle_LQ', 'recycle_HQ_low','recycle_HQ_high']
plt.bar(scennames, e_in_norm['E_in_MWh'], width=0.5)
#Can I sort these to make it pretty?
<BarContainer object of 6 artists>
sum by category and ensure no recycling energy duplication
energy_annual['linear']
| mod_MFG | mod_Install | mod_OandM | mod_Repair | mod_Demount | mod_Store | mod_Resell_Certify | mod_ReMFG_Disassembly | mod_Recycle_Crush | mat_extraction | mat_MFG_virgin | mat_MFGScrap_LQ | mat_MFGScrap_HQ | mat_Landfill | mat_EoL_ReMFG_clean | mat_Recycled_LQ | mat_Recycled_HQ | e_out_annual_[Wh] | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| year | ||||||||||||||||||
| 2023 | 9.538522e+11 | 6.780395e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.748506e+10 | 1.269655e+13 | 0.0 | 0.0 | 3.264828e+08 | 0.0 | 0.0 | 0.0 | 7.658594e+13 |
| 2024 | 8.947572e+11 | 6.360322e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.516271e+10 | 1.190995e+13 | 0.0 | 0.0 | 3.062561e+08 | 0.0 | 0.0 | 0.0 | 1.524576e+14 |
| 2025 | 8.639914e+11 | 6.141626e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.395366e+10 | 1.150043e+13 | 0.0 | 0.0 | 2.957415e+08 | 0.0 | 0.0 | 0.0 | 2.276429e+14 |
| 2026 | 8.443485e+11 | 6.001996e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.318172e+10 | 1.123897e+13 | 0.0 | 0.0 | 2.892067e+08 | 0.0 | 0.0 | 0.0 | 3.021706e+14 |
| 2027 | 8.306867e+11 | 5.904881e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.264483e+10 | 1.105712e+13 | 0.0 | 0.0 | 2.855662e+08 | 0.0 | 0.0 | 0.0 | 3.760693e+14 |
| 2028 | 8.207943e+11 | 5.834562e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.225607e+10 | 1.092544e+13 | 0.0 | 0.0 | 2.859494e+08 | 0.0 | 0.0 | 0.0 | 4.493645e+14 |
| 2029 | 8.135289e+11 | 5.782916e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.197055e+10 | 1.082874e+13 | 0.0 | 0.0 | 2.941085e+08 | 0.0 | 0.0 | 0.0 | 5.220745e+14 |
| 2030 | 8.082319e+11 | 5.745263e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.176239e+10 | 1.075823e+13 | 0.0 | 0.0 | 3.176292e+08 | 0.0 | 0.0 | 0.0 | 5.942027e+14 |
| 2031 | 8.044963e+11 | 5.718709e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.161559e+10 | 1.070851e+13 | 0.0 | 0.0 | 3.696250e+08 | 0.0 | 0.0 | 0.0 | 6.657266e+14 |
| 2032 | 8.020603e+11 | 5.701392e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.151985e+10 | 1.067608e+13 | 0.0 | 0.0 | 4.707864e+08 | 0.0 | 0.0 | 0.0 | 7.365830e+14 |
| 2033 | 8.007521e+11 | 5.692093e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.146844e+10 | 1.065867e+13 | 0.0 | 0.0 | 6.516199e+08 | 0.0 | 0.0 | 0.0 | 8.066492e+14 |
| 2034 | 8.004613e+11 | 5.690026e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.145702e+10 | 1.065480e+13 | 0.0 | 0.0 | 9.545589e+08 | 0.0 | 0.0 | 0.0 | 8.757209e+14 |
| 2035 | 8.011217e+11 | 5.694721e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.148297e+10 | 1.066359e+13 | 0.0 | 0.0 | 1.435357e+09 | 0.0 | 0.0 | 0.0 | 9.434883e+14 |
| 2036 | 8.027021e+11 | 5.705955e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.154508e+10 | 1.068462e+13 | 0.0 | 0.0 | 2.162765e+09 | 0.0 | 0.0 | 0.0 | 1.009514e+15 |
| 2037 | 8.052014e+11 | 5.723721e+11 | 0.0 | 0.0 | 0.000000e+00 | 0.0 | 0.0 | 0.0 | 0.0 | 3.164329e+10 | 1.071789e+13 | 0.0 | 0.0 | 3.215012e+09 | 0.0 | 0.0 | 0.0 | 1.073220e+15 |
| 2038 | 8.086471e+11 | 5.748215e+11 | 0.0 | 0.0 | 5.795608e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.177871e+10 | 1.076376e+13 | 0.0 | 0.0 | 3.229856e+10 | 0.0 | 0.0 | 0.0 | 1.081470e+15 |
| 2039 | 8.130974e+11 | 5.779849e+11 | 0.0 | 0.0 | 5.436546e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.195360e+10 | 1.082299e+13 | 0.0 | 0.0 | 3.042603e+10 | 0.0 | 0.0 | 0.0 | 1.090259e+15 |
| 2040 | 8.186451e+11 | 5.819284e+11 | 0.0 | 0.0 | 5.249613e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.217161e+10 | 1.089684e+13 | 0.0 | 0.0 | 2.944257e+10 | 0.0 | 0.0 | 0.0 | 1.099661e+15 |
| 2041 | 8.254268e+11 | 5.867492e+11 | 0.0 | 0.0 | 5.130263e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.243812e+10 | 1.098711e+13 | 0.0 | 0.0 | 2.881274e+10 | 0.0 | 0.0 | 0.0 | 1.109767e+15 |
| 2042 | 8.336371e+11 | 5.925854e+11 | 0.0 | 0.0 | 5.047254e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.276078e+10 | 1.109639e+13 | 0.0 | 0.0 | 2.837511e+10 | 0.0 | 0.0 | 0.0 | 1.120689e+15 |
| 2043 | 8.435532e+11 | 5.996342e+11 | 0.0 | 0.0 | 4.987148e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.315047e+10 | 1.122838e+13 | 0.0 | 0.0 | 2.805986e+10 | 0.0 | 0.0 | 0.0 | 1.132570e+15 |
| 2044 | 8.555750e+11 | 6.081798e+11 | 0.0 | 0.0 | 4.943003e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.362291e+10 | 1.138840e+13 | 0.0 | 0.0 | 2.783080e+10 | 0.0 | 0.0 | 0.0 | 1.145599e+15 |
| 2045 | 8.702985e+11 | 6.186459e+11 | 0.0 | 0.0 | 4.910818e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.420152e+10 | 1.158439e+13 | 0.0 | 0.0 | 2.766715e+10 | 0.0 | 0.0 | 0.0 | 1.160028e+15 |
| 2046 | 8.886524e+11 | 6.316927e+11 | 0.0 | 0.0 | 4.888121e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.492280e+10 | 1.182869e+13 | 0.0 | 0.0 | 2.755624e+10 | 0.0 | 0.0 | 0.0 | 1.176208e+15 |
| 2047 | 9.121849e+11 | 6.484206e+11 | 0.0 | 0.0 | 4.873320e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.584760e+10 | 1.214193e+13 | 0.0 | 0.0 | 2.749025e+10 | 0.0 | 0.0 | 0.0 | 1.194662e+15 |
| 2048 | 9.437413e+11 | 6.708522e+11 | 0.0 | 0.0 | 4.865371e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.708772e+10 | 1.256197e+13 | 0.0 | 0.0 | 2.746473e+10 | 0.0 | 0.0 | 0.0 | 1.216225e+15 |
| 2049 | 9.894245e+11 | 7.033258e+11 | 0.0 | 0.0 | 4.863604e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 3.888301e+10 | 1.317005e+13 | 0.0 | 0.0 | 2.747833e+10 | 0.0 | 0.0 | 0.0 | 1.242405e+15 |
| 2050 | 1.065721e+12 | 7.575609e+11 | 0.0 | 0.0 | 4.867617e+11 | 0.0 | 0.0 | 0.0 | 0.0 | 4.188136e+10 | 1.418562e+13 | 0.0 | 0.0 | 2.753473e+10 | 0.0 | 0.0 | 0.0 | 1.276653e+15 |
#linear
#selction by multilevel index, then energy category, then sum columns annually
e_linear_annual_mfgs = energy_annual['linear'].filter(items=mfg_energies).sum(axis=1)
e_linear_annual_use = energy_annual['linear'].filter(items=use_energies).sum(axis=1)
e_linear_annual_eol = energy_annual['linear'].filter(items=eol_energies).sum(axis=1)
e_in_linear_annual = e_linear_annual_mfgs+e_linear_annual_use+e_linear_annual_eol
#linear_longlife
#selction by multilevel index, then energy category, then sum columns annually
e_linear_longlife_annual_mfgs = energy_annual['linear_longlife'].filter(items=mfg_energies).sum(axis=1)
e_linear_longlife_annual_use = energy_annual['linear_longlife'].filter(items=use_energies).sum(axis=1)
e_linear_longlife_annual_eol = energy_annual['linear_longlife'].filter(items=eol_energies).sum(axis=1)
e_in_linear_longlife_annual = e_linear_longlife_annual_mfgs+e_linear_longlife_annual_use+e_linear_longlife_annual_eol
# ReMFG_low
e_reMFG_l_annual_mfgs = energy_annual['reMFG_low'].filter(items=mfg_energies).sum(axis=1)
e_reMFG_l_annual_use = energy_annual['reMFG_low'].filter(items=use_energies).sum(axis=1)
e_reMFG_l_annual_eol = energy_annual['reMFG_low'].filter(items=eol_energies).sum(axis=1)
e_reMFG_l_annual_remfg = energy_annual['reMFG_low'].filter(items=eol_remfg_energies).sum(axis=1)
e_in_reMFG_l_annual = e_reMFG_l_annual_mfgs+e_reMFG_l_annual_use+e_reMFG_l_annual_eol+e_reMFG_l_annual_remfg
# ReMFG_high
e_reMFg_h_annual_mfgs = energy_annual['reMFG_high'].filter(items=mfg_energies).sum(axis=1)
e_reMFG_h_annual_use = energy_annual['reMFG_high'].filter(items=use_energies).sum(axis=1)
e_reMFG_h_annual_eol = energy_annual['reMFG_high'].filter(items=eol_energies).sum(axis=1)
e_reMFG_h_annual_remfg = energy_annual['reMFG_high'].filter(items=eol_remfg_energies).sum(axis=1)
e_in_reMFG_h_annual = e_reMFg_h_annual_mfgs+e_reMFG_h_annual_use+e_reMFG_h_annual_eol+e_reMFG_h_annual_remfg
#recycle LQ
e_recycle_LQ_annual_mfgs = energy_annual['recycle_LQ'].filter(items=mfg_energies).sum(axis=1)
e_recycle_LQ_annual_mfgcrap = energy_annual['recycle_LQ'].filter(items=mfg_recycle_energies_LQ).sum(axis=1)
e_recycle_LQ_annual_use = energy_annual['recycle_LQ'].filter(items=use_energies).sum(axis=1)
e_recycle_LQ_annual_eol = energy_annual['recycle_LQ'].filter(items=eol_energies).sum(axis=1)
e_recycle_LQ_annual_recycle = energy_annual['recycle_LQ'].filter(items=eol_recycle_energies_LQ).sum(axis=1)
e_in_recycle_LQ_annual = e_recycle_LQ_annual_mfgs+e_recycle_LQ_annual_mfgcrap+e_recycle_LQ_annual_use+e_recycle_LQ_annual_eol+e_recycle_LQ_annual_recycle
#recycle HQ_low
e_recycle_HQ_low_annual_mfgs = energy_annual['recycle_HQ_low'].filter(items=mfg_energies).sum(axis=1)
e_recycle_HQ_low_annual_mfgscrap = energy_annual['recycle_HQ_low'].filter(items=mfg_recycle_energies_HQ).sum(axis=1)
e_recycle_HQ_low_annual_use = energy_annual['recycle_HQ_low'].filter(items=use_energies).sum(axis=1)
e_recycle_HQ_low_annual_eol = energy_annual['recycle_HQ_low'].filter(items=eol_energies).sum(axis=1)
e_recycle_HQ_low_annual_recycle = energy_annual['recycle_HQ_low'].filter(items=eol_recycle_energies_HQ).sum(axis=1)
e_in_recycle_HQ_low_annual = e_recycle_HQ_low_annual_mfgs+e_recycle_HQ_low_annual_mfgscrap+e_recycle_HQ_low_annual_use+e_recycle_HQ_low_annual_eol+e_recycle_HQ_low_annual_recycle
#recycle HQ_high
e_recycle_HQ_high_annual_mfgs = energy_annual['recycle_HQ_high'].filter(items=mfg_energies).sum(axis=1)
e_recycle_HQ_high_annual_mfgscrap = energy_annual['recycle_HQ_high'].filter(items=mfg_recycle_energies_HQ).sum(axis=1)
e_recycle_HQ_high_annual_use = energy_annual['recycle_HQ_high'].filter(items=use_energies).sum(axis=1)
e_recycle_HQ_high_annual_eol = energy_annual['recycle_HQ_high'].filter(items=eol_energies).sum(axis=1)
e_recycle_HQ_high_annual_recycle = energy_annual['recycle_HQ_high'].filter(items=eol_recycle_energies_HQ).sum(axis=1)
e_in_recycle_HQ_high_annual = e_recycle_HQ_high_annual_mfgs+e_recycle_HQ_high_annual_mfgscrap+e_recycle_HQ_high_annual_use+e_recycle_HQ_high_annual_eol+e_recycle_HQ_high_annual_recycle
e_annual_in_tab = pd.concat([e_in_linear_annual, e_in_linear_longlife_annual, e_in_reMFG_l_annual, e_in_reMFG_h_annual,
e_in_recycle_LQ_annual, e_in_recycle_HQ_low_annual, e_in_recycle_HQ_high_annual],
axis=1, keys=['linear', 'linear_longlife','reMFG_low','reMFG_high', 'recycle_LQ', 'recycle_HQ_low','recycle_HQ_high'])
e_annual_in_tab.to_csv('energy_in_annual.csv')
e_annual_in_tab_cumsum = e_annual_in_tab.cumsum()
e_in_annualANDcumsum = pd.concat([e_annual_in_tab,e_annual_in_tab_cumsum],axis=1, keys=['annual','cumsum'])
e_in_annualANDcumsum.to_csv('energy_in_annualANDcumsum.csv')
plt.plot(e_annual_in_tab_cumsum)
plt.legend(e_annual_in_tab_cumsum.columns)
<matplotlib.legend.Legend at 0x2101a0eedc0>
A calculation of E out is included in the calculateEnergyFlows function.
e_out_sum = r1_e_linear_cum['linear']['e_out_annual_[Wh]']
#Note that because deployment and lifetimes are identical, the energy generated is identical
#for all perovskite scenarios
print('Total 15-year module Energy Generated 2023-2050 is '+str(round((e_out_sum/1e12),2))+ ' TWh.')
Total 15-year module Energy Generated 2023-2050 is 23857.67 TWh.
e_out_annual_TWh = r1_e_linear['e_out_annual_[Wh]']/1e12 # TWh
4.8*365*0.85 # ~2000 kWh/kw
1489.2
plt.plot(e_out_annual_TWh, label='Energy Generated [TWh]')
#PUT ON SECOND AXIS
plt.plot(mass_agg_yearly['ActiveCapacity_perovskite_energies_linear_[MW]']/1e3,
label='Effective Capacity [GW]', color='black')
plt.title('Energy Generated Annually')
plt.ylabel('Energy Generated [TWh/year]')
plt.legend()
<matplotlib.legend.Legend at 0x2101a28ca90>
#perovskite energy out
e_out_annual = r1_e_linear['e_out_annual_[Wh]'] #
#Cumulative annual energy generation
e_out_annual_cumsum = r1_e_linear['e_out_annual_[Wh]'].cumsum()
#long life energy out
e_out_annual_longlife = r1_e_linear_longlife['e_out_annual_[Wh]']
e_out_annual_longlife_cumsum = e_out_annual_longlife.cumsum()
e_outs = pd.concat([e_out_annual,e_out_annual.cumsum(),e_out_annual_longlife,e_out_annual_longlife_cumsum],
axis=1, keys=['e_out_annual_[Wh]','e_out_annual_cumsum[Wh]','e_out_annual_longlife_[Wh]','e_out_annual_long_life_cumsum[Wh]'])
e_outs.to_csv('energy_out_annualANDcumsum.csv')
#EROI = Eout/Ein (note this is not a true eroi because it is missing embedded energy of process materials)
eroi = e_out_sum/e_in
eroi.columns = ['EROI']
eroi
| EROI | |
|---|---|
| linear | 64.978988 |
| reMFG_low | 74.869316 |
| reMFG_high | 96.868501 |
| recycle_LQ | 55.659900 |
| recycle_HQ_low | 72.413145 |
| recycle_HQ_high | 82.248054 |
Can I weight/attribute the EROI by the glass component? mass-wise or energy-wise?
Can I normalize to linear, and then do a relative improvement, since the absolute number doesn't yet account for all the other stuff, but the other layers/materials should be proportional between pathways??
#normalize "EROI"
eroi/eroi.iloc[0]
| EROI | |
|---|---|
| linear | 1.000000 |
| reMFG_low | 1.152208 |
| reMFG_high | 1.490767 |
| recycle_LQ | 0.856583 |
| recycle_HQ_low | 1.114409 |
| recycle_HQ_high | 1.265764 |
Divide the annual energy generation by the annual energy demands, like its annual EROI
e_out_annual = pd.DataFrame(r1_e_linear['e_out_annual_[Wh]'])# Wh
ebalance = pd.DataFrame(index =e_annual_in_tab.index )
for col in e_annual_in_tab.columns:
ebalance[col] = e_out_annual.div(e_annual_in_tab[col],axis=0)
#ebalance
plt.plot(ebalance)
plt.legend(labels=ebalance.columns)
plt.title('Annual Energy Balance')
Text(0.5, 1.0, 'Annual Energy Balance')
ebalance_norm = ebalance.div(ebalance['linear'], axis=0)
#ebalance_norm
plt.plot(ebalance_norm)
plt.legend(labels=ebalance_norm.columns)
plt.title('Annual Energy Balance Normalized')
Text(0.5, 1.0, 'Annual Energy Balance Normalized')
plt.figure(figsize=(8,4))
plt.rcParams.update({'font.size': 12})
plt.plot(ebalance_norm.index, ebalance_norm['linear'], color='black', label='Linear')
plt.plot(ebalance_norm.index, ebalance_norm['reMFG_high'], color='forestgreen', label='ReMFG Perfect',
linestyle='dashed', lw=3)
plt.plot(ebalance_norm.index, ebalance_norm['reMFG_low'], color='limegreen', label='ReMFG low yield',
linestyle='dashed', lw=3)
plt.plot(ebalance_norm.index, ebalance_norm['recycle_HQ_high'], color='royalblue', label='Recycle Perfect',
linestyle='dotted', lw=3)
plt.plot(ebalance_norm.index, ebalance_norm['recycle_HQ_low'], color='deepskyblue',
label='Recycle, closed-loop, low yield', linestyle='dotted', lw=3)
plt.ylabel('Normalized Annual Energy Balance')
plt.legend()
<matplotlib.legend.Legend at 0x2101a4ee550>
While deployment is happening and no EOL circularity, the scenarios are essentially equivalent. The perfect recycling scenario gets a small benefit from MFG Scrap recycling offsetting a small amount of virgin.
Once the 15 year mark is hit and large quantities are removed from the field and while deployment is still increasing, there is a huge energy savings that year, which decreases with time as deloyment continues to increase.
Same message, closed-loop is offsetting virgin is best, and recycling vs reMFG depends on recovery rates.
#e_annual_in_tab/e_out_annual
epbt = 15/ebalance
plt.plot(epbt)
plt.legend(epbt.columns)
<matplotlib.legend.Legend at 0x2101a0631f0>
need to code in did this in excel, currently the energy in is too small to register much, and looks like scenarios above.
#Eout - Ein = ? annually
e_out_annual.subtract(e_annual_in_tab, axis='columns')
| e_out_annual_[Wh] | linear | linear_longlife | reMFG_high | reMFG_low | recycle_HQ_high | recycle_HQ_low | recycle_LQ | |
|---|---|---|---|---|---|---|---|---|
| year | ||||||||
| 2023 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2024 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2025 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2026 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2027 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2028 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2029 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2030 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2031 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2032 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2033 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2034 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2035 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2036 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2037 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2038 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2039 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2040 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2041 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2042 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2043 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2044 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2045 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2046 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2047 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2048 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2049 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2050 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
type(e_out_annual)
pandas.core.frame.DataFrame
We are doing a case study comparing recycling versus remanufacturing the glass for a perovskite module. The assumption is that the perovskite module lasts for 15 years, with weibull parameters that fail 10% of the modules before year 15, and a power degradation such that the module is at 80% of nameplate power at year 15. See the Lifetime vs Recycling journal for calculation of weibull parameters and degradation rates.
The assumption is that a perovskite module will be a glass-glass package. Modern c-Si glass-glass (35% marketshare) bifacial modules (27% marketshare) are most likely 2.5mm front glass (28% marketshare) and 2.5 mm back glass (95% marketshare) [ITRPV 2022]. Therefore, we will assume a perovskite glass glass module will use 2 sheets of glass that are 2.5 mm thick.
density_glass = 2500*1000 # g/m^3
glass_thickness = 2.5/1e3 #m
mass_glass = 2*glass_thickness*density_glass
print('The mass of glass per module area for a perovskite glass-glass package is assumed to be '+
str(mass_glass) + ' g/m^2.')
The mass of glass per module area for a perovskite glass-glass package is assumed to be 12500.0 g/m^2.
We will assume that a perovskite module is disassemble-able or openable with either a laser applied to a vacuum edge seal OR with a hot knife. Laser edge seal can be done with a 16 W laser.
The hot knife procedure with EVA heats the blade to 300 C (https://www.npcgroup.net/eng/solarpower/reuse-recycle/dismantling#comp) and is currently only used on glass-backsheet modules. The NPC website indicates that cycle time is 60 seconds for one 6x10 cell module. Small commercially availble hot knives can achieve greater than 300C drawing less than 150W. We will assume worst case scenario; hot knife for 60 seconds at 150 W
e_hotknife_tot = 150*60*(1/3600)#*(1/1000) # 150 W * 60 s = W*s *(hr/s)*(kW/W)
area_mod = 1.090*2.100 #m
e_hotknife = e_hotknife_tot/area_mod # E/module to E/m2
print('Energy for hot knife separation is '+ str(round(e_hotknife, 4))+' kWh/m2. This will be used as energy of module reMFG Disassembly')
Energy for hot knife separation is 1.0922 kWh/m2. This will be used as energy of module reMFG Disassembly
The process to remove the perovskite from the glass is relatively simple regardless of architecture (all back contact or stack). A dunk in a water-based solvent at room temperature can remove the perovskite layer, and simple heating/baking or UV+Ozone steps should round out the cleaning preparation for a new perovskite deposition.
Using Rodriguez-Garcia G, Aydin E, De Wolf S, Carlson B, Kellar J, Celik I. Life Cycle Assessment of Coated-Glass Recovery from Perovskite Solar Cells. ACS Sustainable Chem Eng [Internet]. 2021 Nov 3 [cited 2021 Nov 8]; Available from: https://doi.org/10.1021/acssuschemeng.1c05029, we will assume a room temperature water bath with sonication, a heating/drying/baking step, and a UV+Ozone step.
e_sonicate = 4 #kWh/m2 ultrasonication
e_uvozone = 3.57 #kWh/m2 ozone+UV
e_bake = 0.06 #kWh/m2 hot plate drying
e_glassreMFG_area = e_sonicate+e_uvozone+e_bake
e_glass_reMFG_mass = e_glassreMFG_area/(mass_glass/1000) #kWh/m2 *m2/g
print('Energy to remanufacture the glass (material energy only) is ' + str(round(e_glass_reMFG_mass, 2)) + 'kWh/kg')
Energy to remanufacture the glass (material energy only) is 0.61kWh/kg
ReEDS deployment curve for solar futures is a complex deployment, which will obfuscate the results of our energy flows. To mitage that, we will develop an exponential decay deployment curve to meet the targets as layed out by Solar Futures, namely, 1.6 TW in 2050. If we can also hit 1.0 TW in 2035, that is bonus
# Import curve fitting package from scipy
from scipy.optimize import curve_fit
# Function to calculate the power-law with constants a and b
def power_law(x, a, b):
return a*np.power(x, b)
#generate a dataset for deployment between 2023 and 2050
deployed_2022 = 100000# y value in MW of already deployed PV
x_vals = pd.Series(range(2021,2051)) # x values
#exponential decay function
y_dummy = power_law(x_vals-2021, deployed_2022, 0.85)
#play around with the exponential until y_dummy[31] hits 1.7 TW (DC)
print(str(y_dummy[14]/1e6) + ' TW in 2035')
print(str(y_dummy[29]/1e6) + ' TW in 2050')
plt.plot(y_dummy)
0.9423426126631159 TW in 2035 1.7500010054785993 TW in 2050
[<matplotlib.lines.Line2D at 0x2101ac754f0>]
#dataframe the cumulative deployements
deployments = pd.DataFrame()
deployments['CumulativeDeploy[MW]'] = y_dummy
deployments.index = x_vals
#take the annual difference to de-cumulate
deployments['AnnualDeploy[MW]'] = deployments['CumulativeDeploy[MW]']-deployments['CumulativeDeploy[MW]'].shift(1).fillna(0)
plt.plot(deployments)
plt.legend(deployments.columns)
<matplotlib.legend.Legend at 0x2101aca5340>
plt.plot(deployments['AnnualDeploy[MW]'])
plt.title('Annual Deployments Meeting 1.7 TW in 2050')
plt.ylabel('Annual Deploy [MW]')
Text(0, 0.5, 'Annual Deploy [MW]')
reversedeploy = deployments['AnnualDeploy[MW]'].iloc[::-1] #save off reverse deploy as series
reversedeploy.index = deployments.index #reapply the index to put back into df
deployments['AnnualDeploy_rev[MW]'] = reversedeploy #add to df
deployments['CumulativeReverse[MW]'] = deployments['AnnualDeploy_rev[MW]'].cumsum()
print(str(deployments['CumulativeReverse[MW]'][2035]/1e6) + ' TW in 2035')
print(str(deployments['CumulativeReverse[MW]'][2050]/1e6) + ' TW in 2050')
0.8076583928154834 TW in 2035 1.7500010054785993 TW in 2050
plt.plot(deployments['AnnualDeploy_rev[MW]'])
plt.title('Annual Deployments Meeting 1.7 TW in 2050')
plt.ylabel('Annual Deploy [MW]')
Text(0, 0.5, 'Annual Deploy [MW]')
deployments.to_csv('alternatedeployment.csv')